//package com.ibeetl.cms.web;
//
//import com.ibeetl.admin.core.annotation.Function;
//import com.ibeetl.admin.core.file.FileService;
//import com.ibeetl.admin.core.util.ConvertUtil;
//import com.ibeetl.admin.core.util.ParamUtil;
//import com.ibeetl.admin.core.util.ValidateConfig;
//import com.ibeetl.admin.core.web.JsonResult;
//import com.ibeetl.cms.entity.CmsArticleTag;
//import com.ibeetl.cms.service.CmsArticleTagService;
//import com.ibeetl.cms.web.query.CmsArticleTagQuery;
//import org.apache.commons.lang3.StringUtils;
//import org.apache.commons.logging.Log;
//import org.apache.commons.logging.LogFactory;
//import org.beetl.sql.core.engine.PageQuery;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.ResponseBody;
//import org.springframework.web.servlet.ModelAndView;
//
//import javax.servlet.http.HttpServletRequest;
//import java.util.List;
//
///**
// * CmsArticleTag 接口
// */
//@Controller
//public class CmsArticleTagController{
//
//    private final Log log = LogFactory.getLog(this.getClass());
//    private static final String MODEL = "/cms/cmsArticleTag";
//
//
//    @Autowired private CmsArticleTagService cmsArticleTagService;
//
//    @Autowired
//    FileService fileService;
//    /* 页面 */
//
//    @GetMapping(MODEL + "/index.do")
//    @Function("cms.cmsArticleTag.query")
//    @ResponseBody
//    public ModelAndView index() {
//        ModelAndView view = new ModelAndView("/cms/cmsArticleTag/index.html") ;
//        view.addObject("search", CmsArticleTagQuery.class.getName());
//        return view;
//    }
//
//    @GetMapping(MODEL + "/edit.do")
//    @Function("cms.cmsArticleTag.edit")
//    @ResponseBody
//    public ModelAndView edit(Integer id) {
//        ModelAndView view = new ModelAndView("/cms/cmsArticleTag/edit.html");
//        CmsArticleTag cmsArticleTag = cmsArticleTagService.queryById(id);
//        view.addObject("cmsArticleTag", cmsArticleTag);
//        return view;
//    }
//
//    @GetMapping(MODEL + "/add.do")
//    @Function("cms.cmsArticleTag.add")
//    @ResponseBody
//    public ModelAndView add() {
//        ModelAndView view = new ModelAndView("/cms/cmsArticleTag/add.html");
//        return view;
//    }
//
//    /* ajax json */
//
//    @PostMapping(MODEL + "/list.json")
//    @Function("cms.cmsArticleTag.query")
//    @ResponseBody
//    public JsonResult<PageQuery> list(CmsArticleTagQuery condtion)
//    {
//        PageQuery page = condtion.getPageQuery();
//        cmsArticleTagService.queryByCondition(page);
//        return JsonResult.success(page);
//    }
//
//    @PostMapping(MODEL + "/add.json")
//    @Function("cms.cmsArticleTag.add")
//    @ResponseBody
//    public JsonResult add(@Validated(ValidateConfig.ADD.class)CmsArticleTag cmsArticleTag, HttpServletRequest request)
//    {
//        cmsArticleTagService.save(cmsArticleTag);
//        return new JsonResult().success();
//    }
//
//    @PostMapping(MODEL + "/edit.json")
//    @Function("cms.cmsArticleTag.edit")
//    @ResponseBody
//    public JsonResult<String> update(@Validated(ValidateConfig.UPDATE.class)  CmsArticleTag cmsArticleTag, HttpServletRequest request) {
//    	CmsArticleTag cmsArticleTagDb = cmsArticleTagService.queryById(cmsArticleTag.getId());
//
//    	if (cmsArticleTagDb == null) cmsArticleTagDb = new CmsArticleTag();
//    	cmsArticleTagDb = ParamUtil.initParameterObj(request, cmsArticleTagDb);
//
//    	boolean success = cmsArticleTagService.update(cmsArticleTag);
//        if (success) {
//            return new JsonResult().success();
//        } else {
//            return JsonResult.failMessage("保存失败");
//        }
//    }
//
//
//
//    @GetMapping(MODEL + "/view.json")
//    @Function("cms.cmsArticleTag.query")
//    @ResponseBody
//    public JsonResult<CmsArticleTag>queryInfo(Integer id) {
//        CmsArticleTag cmsArticleTag = cmsArticleTagService.queryById( id);
//        return  JsonResult.success(cmsArticleTag);
//    }
//
//    @PostMapping(MODEL + "/delete.json")
//    @Function("cms.cmsArticleTag.delete")
//    @ResponseBody
//    public JsonResult delete(String ids) {
//        if (ids.endsWith(",")) {
//            ids = StringUtils.substringBeforeLast(ids, ",");
//        }
//        List<Long> idList = ConvertUtil.str2longs(ids);
//        cmsArticleTagService.batchDelCmsArticleTag(idList);
//        return new JsonResult().success();
//    }
//
//
//}
